package ltq.servlet;

import ltq.dao.TestDao;
import ltq.model.BrandGenderAVGAge;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

@WebServlet("/ts")
public class TestServlet extends HttpServlet {
    TestDao testDao=new TestDao();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        List<BrandGenderAVGAge> list=new ArrayList<>();
        list=testDao.TestFunction();
        req.setAttribute("bgaList",list);
        req.getRequestDispatcher("Test.jsp").forward(req,resp);
    }
}
